1. Field of the Invention
The invention relates generally to databases and more specifically to supporting replication of data stored as structured data in a database.
2. Related Art
Databases have long been used to store the vast amounts of information required by modern companies, educational institutions, governments, and the like. Most modern database systems are de-centralized in that they include several databases that are separated functionally and geographically. One approach for organizing the several databases is to have a primary database and one or more replicate databases that contain mirror copies of the data contained on the primary database. When the content of the primary database is changed, that change must be “replicated” in the replicate databases in order to ensure the integrity of the mirror copies.
Given the large amount of data normally stored on a given database, it is frequently infeasible to replicate the data contained on the primary database by simply copying the entire content of the primary database to the replicate databases. Instead, data replication is accomplished using log-based technology. Through the use of log-based replication, changes to the data in the primary database are captured in a transaction log.
A replication agent can be used to read the primary database's transaction log and propagate the changes to the replicate databases. After replication, each replicate database contains accurate and current copies of the subsets of data found in the primary database. However, not all tables in the primary database may be replicated. Instead, only when a table in the primary database is marked for replication, replication agent replicates transactions that manipulate the marked table.
Many databases have a native structured data type that lets the database understand that a column or table contains structured data. In many ways, this is similar to the way that, for instance, date and timestamp data types allow a database to understand that a column contains a date. Additionally, the structured data type may provide or be associated with methods that allow common operations such as schema validation and transformation of content. These data types can be used like any other data type and can be used, for instance, when (a) creating a column in a relational table; (b) declaring PL/SQL (Procedural Language/Structured Query Language) variables; and (c) defining and calling PL/SQL procedures and functions. One example of such a structured data type is the extensible markup language (XML) type. In addition to the functionality outlined above, the XML type allows a user to create a table of XML type. Such a table or column can, by default, contain any well-formed XML document.
Many databases that support the XML type perform a XML data validation check prior to replication in order to ensure the data contains a well-formed XML document. If the data is a fall well-formed XML document, then it will pass validation. However, when less than a complete XML document is to be replicated (as could be the case with log-based replication), a validation error occurs. As noted above, it is frequently desirable, or even necessary, to replicate less than a full XML document. Therefore, what is needed are systems, methods, and computer program products that allow a replication agent to facilitate replication of structured data that may or may not constitute a full and well-formed structured document.